var baseMsg = JSON.parse('{"CODE":0, "ACTION":"","LEVEL":"T1", "MSG":"","DATA":"","SCRIPTNAME":"sam_price_change_cost_type"}');

var costChangeEnmu = ['长期降成本', '短期降成本', '长期涨成本', '短期涨成本'];

if (key_name == 'sam-price-change-cost-type' || key_name == 'ALL') {

    baseMsg.CODE = 5;

}

baseMsg.DATA = JSON.stringify(costChangeEnmu);

JSON.stringify(baseMsg);